package com.djmw.mouse.repository;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.djmw.mouse.entity.Application;
import com.djmw.mouse.entity.ApplicationId;

public interface ApplicationDao extends PagingAndSortingRepository<Application, ApplicationId>,
JpaSpecificationExecutor<Application> {

    @Query("select application from Application application where application.pk.position.id = ?1 and application.pk.cvLang.id = ?2 and application.pk.memberUser.id = ?3")
    Application findExistingApplicaiton(Long positionId, Long cvLangId, Long memberUserId);

    // @Query("select Application application where pk.memberUser.id = ?1")
    // List<Application> findByMemberUserId(Long memberUserId);
}
